import { SERVER_BASE, http } from "./config";
import qs from "qs";

export default {
    //获取期数
    getALLSchool() {
        return http.get(SERVER_BASE + "/getALLSchool");
    },
    //查看该学期未完成评价任务的学员名单
    listOfNotCriticism(schoolId) {
        return http.get(SERVER_BASE + "/student/listOfNotCriticism?school_id="+schoolId);
    },
    //查看该学期已完成评价任务的学员名单
    listOfCriticism(schoolId) {
        return http.get(SERVER_BASE + "/student/listOfCriticism?school_id="+schoolId);
    },
    // 根据课程类型获取对应的问卷，不分期数
    getAllQuestion(cm_type_id) {
        return http.get(SERVER_BASE + "/getstudent/?cm_type="+cm_type_id);
    },
    // 创建问卷,将设置好的问卷数据发送到后台
    addQuestionnaire(naireData) {
        return http.post(SERVER_BASE + "/create/insert_comment",naireData);
    },
    // 编辑更新问卷
    updateQuestionnaire(naireData) {
        return http.post(SERVER_BASE + "/update/comment",naireData);
    },
    // 删除整个问卷
    deleteQuestionnaire(model_cm_id) {
        return http.delete(SERVER_BASE + "/delete/comment",{params: model_cm_id});
    },
    // 删除课程评价问卷信息中的具体第几题
    deleteDetailQuestionnaire(detail_cm_id) {
        return http.delete(SERVER_BASE + "/delete/comment_detail",{params: detail_cm_id});
    },
    // 查询所有启用模板
    getAllPublished(cm_type_id) {
        return http.get(SERVER_BASE + "/select/stu_model", {params: cm_type_id});
    },
    // 启用问卷
    enableQuestionnaire(comment_student ) {
        return http.post(SERVER_BASE + "/select/commentmodel",comment_student);
    },
    //下载问卷
    evaDownload(course_type,school_id){
        return http.get(SERVER_BASE + "/download?"+"course_type=" + course_type+ "&school_id=" + school_id);

    },
};